<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<h:head>
	<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/styles.css" />
	<title>Modifica Pachetto</title>
</h:head>

<h:body>
<div id="header">
	<ui:include src="/resources/snippets/headerDipendente.xhtml"></ui:include>
</div>
	<h1>Modifica Pacchetto</h1>
	<p>Stai modificando il pacchetto con id #{pacchetto.current.pacchettoID}</p>
	<h:outputText value="  Città Selezionata: #{pacchetto.current.citta}"/><br/>
	<br/>
	<h:form>
		<h:outputText value="Pacchetto in vetrina: " />  
        <h:selectBooleanCheckbox value="#{pacchetto.current.inVetrina}" /> <br/>
        <br/>
 		<h:outputText value="Volo di Andata: " />
        <h:selectOneMenu id="voloA" value="#{pacchetto.current.voloAndata}" converter="omnifaces.SelectItemsConverter">
        	<f:selectItems value="#{pacchetto.listaVoliAndata}" var="currVoloAnd" itemValue="#{currVoloAnd}" itemLabel="#{currVoloAnd.cittaPartenza} - #{currVoloAnd.cittaArrivo} , #{currVoloAnd.ora} , #{currVoloAnd.compagnia}"/>
        </h:selectOneMenu> <br/>
        <br/>
        <h:outputText value="Volo di Ritorno: " />
        <h:selectOneMenu id="voloR" value="#{pacchetto.current.voloRitorno}" converter="omnifaces.SelectItemsConverter">
        	<f:selectItems value="#{pacchetto.listaVoliRitorno}" var="currVoloRit" itemValue="#{currVoloRit}" itemLabel="#{currVoloRit.cittaPartenza} - #{currVoloRit.cittaArrivo} , #{currVoloRit.ora} , #{currVoloRit.compagnia}"/>
		</h:selectOneMenu> <br/>
		<br/>
		<h:outputText value="Hotels: " />  
        <p:selectCheckboxMenu id="hotels" label="Seleziona Hotels" value="#{pacchetto.current.hotels}" converter="omnifaces.SelectItemsConverter" showCheckbox="true">  
            <f:selectItems value="#{pacchetto.listaHotel}" var="currHotel" itemValue="#{currHotel}" itemLabel="#{currHotel.nome}, #{currHotel.citta}, #{currHotel.numStelle} stelle"/> 
        </p:selectCheckboxMenu> <br/>
		<br/>
		<h:outputText value="Escursioni: " />  
        <p:selectCheckboxMenu id="escs" label="Seleziona Escursioni" value="#{pacchetto.current.escursioni}" converter="omnifaces.SelectItemsConverter" showCheckbox="true">  
            <f:selectItems value="#{pacchetto.listaEscursioni}" var="currEsc" itemValue="#{currEsc}" itemLabel="#{currEsc.citta}, #{currEsc.luogoInteresse}, #{currEsc.ora}"/> 
        </p:selectCheckboxMenu> <br/>
		<br/>
		<h:commandButton value="Salva modifiche" action="#{pacchetto.update()}"/> <br/>
		<br/>
	</h:form>
	<br/>
	<br/>
   	<br/>
	<h:link outcome="index" value="Torna alla Home" /> <br/>
	<br/>
	<br/>
	<br/>
<div id="footer">
	<ui:include src="/resources/snippets/footer.xhtml"></ui:include>
</div>
</h:body>
</html>